#[cfg(test)]
mod test {
    #[derive(Debug)]
    struct Student {
        score: u32,
        grade: Option<String>,
    }

    impl Student {
       fn set_grade(&mut self){
        self.grade = match self.score{
            90..=100 => Some("A".to_string()),
            80..=89 => Some("B".to_string()),
            70..=79 => Some("C".to_string()),
            60..=69 => Some("D".to_string()),
            _=> Some("F".to_string()),
        }
       }
    }

    #[test]
    fn main() {
        let mut students = vec![
            Student{score:95,grade:None},
            Student{score:85,grade:None},
            Student{score:75,grade:None},
            Student{score:65,grade:None},
            Student{score:55,grade:None},
        ];
        for stu in &mut students {
            stu.set_grade();
        }

        for stuf in &students {
            println!("{:?}", stuf);
        }
    }
}
